﻿function getFromStore(key, prefix) {
    if (localStorage.getItem(key) === null) {
        return null;
    };

    var retVal = String(localStorage.getItem(key));

    if (prefix) {
        retVal = prefix + retVal;
    };

    return retVal;
};

function saveToStore(key, value) {
    if (getFromStore(key)) {
        localStorage.removeItem(key);
    };

    localStorage.setItem(key, value);
};

function getTheme1() {
    return getFromStore("theme1") || "ace/theme/monokai";
};

function getTheme2() {
    return getFromStore("theme2") || "ace/theme/tomorrow_night_blue";
};

function getMode1() {
    return getFromStore("language1", "ace/mode/") || "ace/mode/html";
};

function getMode2() {
    return getFromStore("language2", "ace/mode/") || "ace/mode/html";
};
